using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace zeroflag.Windows
{
	public class TreeViewItem<T> : TreeNode, ITreeNodeRenderable
	{
		#region Constructors
		public TreeViewItem()
			: base()
		{
		}

		public TreeViewItem(T value)
			: base()
		{
			this.Value = value;
		}
		#endregion

		public T Value
		{
			get { return (T)base.Tag; }
			set { base.Tag = value; this.Text = value.ToString(); }
		}

		public virtual void Render(System.Windows.Forms.DrawTreeNodeEventArgs e)
		{
			e.Graphics.DrawString(this.Text, this.TreeView.Font, new System.Drawing.SolidBrush(this.TreeView.ForeColor), this.Bounds.Location);
		}
	}
}
